#include "MTMethodCall.hpp"
#include "MTExpression.hpp"
#include "MTIdentifier.hpp"
#include <iostream>
#include <sstream>
#include <string>

namespace MathematicaTranslator
{	
 	std::string* MTMethodCall::generateCode(CodeGenContext& context)
	{
		std::ostringstream ss;
		ss << *id.generateCode(context);
		ss << "(";
		for (int i = exprList.size() - 1; i>=0; --i){
			ss << *exprList.at(i)->generateCode(context);
			if (i>0) ss << ", ";
		}
		ss << ")";

		return new std::string(ss.str());
	}
}
